<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HSLToRGB</title>
</head>

<body>
    <p id="res"></p>
    <script>
        const HSLToRGB = (h, s, l) => {
            s /= 100;
            l /= 100;
            const k = n => (n + h / 30) % 12;
            const a = s * Math.min(l, 1 - l);
            const f = (n) => l - a * Math.max(-1, Math.min(k(n) - 3, 9 - k(n), 1));
            return [255 * f(0), 255 * f(8), 255 * f(4)];
        }
        const res = document.getElementById('res');
        //     HSLToRGB(13, 100, 11); // [56.1, 12.155, 0] 
        res.innerHTML = `HSLToRGB(13, 100, 11);的结果是:${JSON.stringify(HSLToRGB(13, 100, 11))}`;
    </script>
</body>

</html>